From 810e86d4fbe6b52ccf4412e08299699d7091b859 Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Wed, 1 Dec 2021 15:13:57 +0000 Subject: [PATCH] lib: fix new clippy warnings This fixes the following warnings highlighted by clippy: * https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark * https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure * https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports --- rust-bindings/rust/src/kernel_args.rs | 2 -- rust-bindings/rust/src/object_details.rs | 1 - rust-bindings/rust/src/object_name.rs | 1 - rust-bindings/rust/src/repo.rs | 3 +-- rust-bindings/rust/src/sysroot.rs | 2 +- 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/rust-bindings/rust/src/kernel_args.rs b/rust-bindings/rust/src/kernel_args.rs index 94b41771..ea7fc532 100644 --- a/rust-bindings/rust/src/kernel_args.rs +++ b/rust-bindings/rust/src/kernel_args.rs @@ -1,7 +1,5 @@ use ffi::OstreeKernelArgs; #[cfg(any(feature = "v2019_3", feature = "dox"))] -use gio; -#[cfg(any(feature = "v2019_3", feature = "dox"))] use glib::object::IsA; use glib::translate::*; #[cfg(any(feature = "v2019_3", feature = "dox"))] diff --git a/rust-bindings/rust/src/object_details.rs b/rust-bindings/rust/src/object_details.rs index fcf13d61..f6adcc81 100644 --- a/rust-bindings/rust/src/object_details.rs +++ b/rust-bindings/rust/src/object_details.rs @@ -1,4 +1,3 @@ -use glib; use std::fmt::Display; use std::fmt::Formatter; use std::fmt::Error; diff --git a/rust-bindings/rust/src/object_name.rs b/rust-bindings/rust/src/object_name.rs index a69fee67..06ff8045 100644 --- a/rust-bindings/rust/src/object_name.rs +++ b/rust-bindings/rust/src/object_name.rs @@ -1,6 +1,5 @@ use crate::ObjectType; use crate::{object_name_deserialize, object_name_serialize, object_to_string}; -use glib; use glib::translate::*; use glib::GString; use std::fmt::Display; diff --git a/rust-bindings/rust/src/repo.rs b/rust-bindings/rust/src/repo.rs index edec8dc5..6a44103b 100644 --- a/rust-bindings/rust/src/repo.rs +++ b/rust-bindings/rust/src/repo.rs @@ -1,7 +1,6 @@ #[cfg(any(feature = "v2016_4", feature = "dox"))] use crate::RepoListRefsExtFlags; use crate::{Checksum, ObjectName, ObjectDetails, ObjectType, Repo, RepoTransactionStats}; -use ffi; use ffi::OstreeRepoListObjectsFlags; use glib::ffi as glib_sys; use glib::{self, translate::*, Error, IsA}; @@ -117,7 +116,7 @@ impl Repo { let copy = dfd.try_clone(); // Now release our temporary ownership of the original let _ = dfd.into_raw_fd(); - Ok(copy?) + copy } } diff --git a/rust-bindings/rust/src/sysroot.rs b/rust-bindings/rust/src/sysroot.rs index 84ef2f89..5255c286 100644 --- a/rust-bindings/rust/src/sysroot.rs +++ b/rust-bindings/rust/src/sysroot.rs @@ -49,7 +49,7 @@ impl SysrootBuilder { /// Perform common configuration steps, returning a not-yet-fully-loaded `Sysroot`. fn configure_common(self) -> Sysroot { let sysroot = { - let opt_file = self.path.map(|p| gio::File::for_path(p)); + let opt_file = self.path.map(gio::File::for_path); Sysroot::new(opt_file.as_ref()) }; -- 2.30.2